<?php

// Resize the given image to a dest path. Src must exist
// If original size is smaller, do not resize just make a copy



function cImageTypeToExt($type)
{
	$type = JString::strtolower($type);

	if( $type == 'image/png' || $type == 'image/x-png' )
	{
		return '.png';
	}
	elseif ( $type == 'image/gif')
	{
		return '.gif';
	}
	
	// We default to use jpeg
	return '.jpg';
}




function cImageGetSize( $source )
{
	$obj		= new stdClass();
	
	list( $obj->width , $obj->height) = getimagesize( $source );
	
	return $obj;
}

